import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  { //登陆页面
    path: '/login',
    name: ' login',
    component: () => import('../views/Login.vue')
  },
  { //登陆页面
    path: '/index',
    name: ' index',
    component: () => import('../views/index.vue'),
     children: [{
      path: '/users',
      name: 'Users',
      component: () => import('../views/Users.vue')
    },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
